<template>
  <div class="top">
    <div class="left">
      <img :src="userInfo.staffPhoto" alt="" v-imgerror="errorImg" />
    </div>
    <div class="right">
      <h4>{{ userInfo.username }}</h4>
      <div>
        <span
          >手机 <i>{{ userInfo.mobile }}</i></span
        ><span
          >部门 <i>{{ userInfo.departmentName }}</i>
        </span>
      </div>
      <div class="time">
        入职时间 <i> {{ userInfo.timeOfEntry | formatTime }}</i>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'User',
  props: ['userInfo'],
  data() {
    return {
      errorImg:require('@/assets/common/bigUserHeader.png')
    }
  },
  created () {
    console.log('userInfo',this.userInfo)
  }
}
</script>

<style lang="scss" scoped>
.top {
  height: 130px;
  .left {
    float: left;
    width: 100px;
    height: 100px;
    margin: 10px 50px 0 20px;
    img {
      display: block;
      border-radius: 50%;
      background-color: #bbb;
      height: 100%;
      width: 100%;
    }
  }
  .right {
    float: left;
    span {
      margin-right: 10px;
    }
    i {
      color: #ccc;
      font-style: normal;
    }
    .time {
      margin-top: 10px;
    }
  }
}
</style>
